<template>
    <header class="my-back">
        <span class="i-left" @click="goBack"></span>
        <div class="title">
            <slot></slot>
        </div>
    </header>
</template>

<script>
export default {
    methods: {
        // 跳转上一个页面
        goBack() {
            // 利用router实例调用api (编程式导航)
            // this.$router.push({
            //   path: "/home",
            //   query:{}
            // });

            this.$router.back()
        },
    }
}
</script>

<style scoped lang="less">
@import "../static/less/variable.less";
.my-back {
    width: 100%;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .i-left {
        display: block;
        width: 24px;
        height: 24px;
        background-image: url(../static/images/i-arrow-left.png);
        background-size: cover;
    }
}</style>